#include "Queue.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
int Queue::deQueue(){
    int el=queue[0];
    for (int i = 0; i < size; i++)
    {
        queue[i]=queue[i+1];
        /* code */
    }
    
    size--;
    return el;
    
}
Queue::Queue(int capacity){
    queue=new int[capacity];
    this->capacity=capacity;
    size=0;
}

void Queue::traverse(){
    for (int i = 0; i < size; i++)
    {
        cout<<queue[i];
        /* code */
    }
    
}
void Queue::enqueue(int val){
    if (size>capacity)
    {
        cout<<"队列已经满了,无法进行插入动作"<<endl;
        /* code */
    }
    else{
    queue[size++]=val;
    }

}